package com.soft.base.spring.log.config;

import com.soft.base.log.LogUtil;
import com.soft.base.log.LogUtil;
import com.soft.base.log.LogUtil;
import com.soft.base.log.LogUtil;
import com.soft.base.log.LogUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.event.EventListener;
import org.springframework.util.StringUtils;

/**
 * class
 *
 * @author user
 * @date 2020/06/05
 */
public class BaseLogReportConfig {

    @Value("${spring.application.name}")
    private String app;
    @Value("${log.report.url:}")
    private String url;

    @EventListener(ApplicationReadyEvent.class)
    public void onStartUp() {
        if (!StringUtils.isEmpty(url)) {
            LogUtil.start(app, url);
        }
    }

}
